package scratch.InfoEssentials;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JToolBar;
import java.awt.BorderLayout;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.border.LineBorder;
import java.awt.Color;
import javax.swing.border.TitledBorder;
import javax.swing.JList;
import javax.swing.JRadioButton;
import javax.swing.JTextPane;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class MainUI {

	private JFrame mianUI;
	private JTextField tfUsername;
	private JPasswordField tfPassword;
	private JTextField tfCookie;
	private JTextField tfURL;
	private JTextField tf_keywords;
	private JTextField textField_4;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainUI window = new MainUI();
					window.mianUI.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public MainUI() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		mianUI = new JFrame();
		mianUI.setTitle("Info Essentails");
		mianUI.setBounds(100, 100, 732, 474);
		mianUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		mianUI.getContentPane().setLayout(null);
		
		JPanel panel_UserInfo = new JPanel();
		panel_UserInfo.setBorder(new TitledBorder(null, "User Info", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_UserInfo.setBounds(10, 5, 447, 73);
		mianUI.getContentPane().add(panel_UserInfo);
		panel_UserInfo.setLayout(null);
		
		JLabel lblUsername = new JLabel("Username");
		lblUsername.setBounds(12, 21, 60, 14);
		panel_UserInfo.add(lblUsername);
		
		tfUsername = new JTextField();
		tfUsername.setBounds(70, 16, 69, 20);
		panel_UserInfo.add(tfUsername);
		tfUsername.setColumns(10);
		
		JLabel lblPassword = new JLabel("Password");
		lblPassword.setBounds(149, 21, 46, 14);
		panel_UserInfo.add(lblPassword);
		
		tfPassword = new JPasswordField();
		tfPassword.setBounds(205, 16, 112, 20);
		panel_UserInfo.add(tfPassword);
		
		JButton btnLogin = new JButton("Login");
		btnLogin.setBounds(324, 15, 89, 23);
		panel_UserInfo.add(btnLogin);
		
		JLabel lblCookie = new JLabel("cookie");
		lblCookie.setBounds(12, 42, 46, 14);
		panel_UserInfo.add(lblCookie);
		
		tfCookie = new JTextField();
		tfCookie.setBounds(71, 41, 342, 20);
		panel_UserInfo.add(tfCookie);
		tfCookie.setColumns(10);
		
		JPanel panel_InfoItem = new JPanel();
		panel_InfoItem.setBorder(new TitledBorder(null, "Info Item", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_InfoItem.setBounds(10, 82, 447, 316);
		mianUI.getContentPane().add(panel_InfoItem);
		panel_InfoItem.setLayout(null);
		
		JLabel lblUrl = new JLabel("URL");
		lblUrl.setBounds(20, 33, 46, 14);
		panel_InfoItem.add(lblUrl);
		
		tfURL = new JTextField();
		tfURL.setBounds(72, 30, 251, 20);
		panel_InfoItem.add(tfURL);
		tfURL.setColumns(10);
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setBounds(30, 132, 46, 14);
		panel_InfoItem.add(lblNewLabel);
		
		JLabel lblSummary = new JLabel("Summary");
		lblSummary.setBounds(18, 99, 46, 14);
		panel_InfoItem.add(lblSummary);
		
		JEditorPane ed_Summary = new JEditorPane();
		ed_Summary.setBackground(Color.WHITE);
		ed_Summary.setBounds(74, 120, 351, 72);
		panel_InfoItem.add(ed_Summary);
		
		JButton btnDone = new JButton("Done");
		btnDone.setBounds(335, 261, 89, 23);
		panel_InfoItem.add(btnDone);
		
		JLabel lblKeywords = new JLabel("Keywords");
		lblKeywords.setBounds(20, 66, 66, 14);
		panel_InfoItem.add(lblKeywords);
		
		JList list_Category = new JList();
		list_Category.setBounds(72, 63, 76, 20);
		panel_InfoItem.add(list_Category);
		
		JList list_Subcategory = new JList();
		list_Subcategory.setBounds(166, 63, 81, 21);
		panel_InfoItem.add(list_Subcategory);
		
		tf_keywords = new JTextField();
		tf_keywords.setBounds(259, 62, 178, 22);
		panel_InfoItem.add(tf_keywords);
		tf_keywords.setColumns(10);
		
		JLabel lblAction = new JLabel("Action");
		lblAction.setBounds(20, 206, 46, 14);
		panel_InfoItem.add(lblAction);
		
		JRadioButton rdbtnFixed = new JRadioButton("Fixed");
		rdbtnFixed.setBounds(312, 202, 60, 23);
		panel_InfoItem.add(rdbtnFixed);
		
		JRadioButton rdbtnSensitive = new JRadioButton("sensitive");
		rdbtnSensitive.setBounds(234, 202, 76, 23);
		panel_InfoItem.add(rdbtnSensitive);
		
		JRadioButton rdbtnGeneral = new JRadioButton("General");
		rdbtnGeneral.setBounds(72, 202, 66, 23);
		panel_InfoItem.add(rdbtnGeneral);
		
		JRadioButton rdbtnFocus = new JRadioButton("Focus");
		rdbtnFocus.setBounds(155, 202, 66, 23);
		panel_InfoItem.add(rdbtnFocus);
		
		JLabel lblRemark = new JLabel("Remark");
		lblRemark.setBounds(18, 231, 46, 14);
		panel_InfoItem.add(lblRemark);
		
		textField_4 = new JTextField();
		textField_4.setBounds(72, 228, 353, 20);
		panel_InfoItem.add(textField_4);
		textField_4.setColumns(10);
		
		JButton btnFetch = new JButton("Fetch");
		btnFetch.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				
			}
		});
		btnFetch.setBounds(336, 29, 89, 23);
		panel_InfoItem.add(btnFetch);
		
		JPanel panel_InfoItemPreview = new JPanel();
		panel_InfoItemPreview.setBorder(new TitledBorder(null, "Info Item Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_InfoItemPreview.setBounds(467, 11, 239, 387);
		mianUI.getContentPane().add(panel_InfoItemPreview);
		panel_InfoItemPreview.setLayout(null);
		
		JTextPane tp_Preview = new JTextPane();
		tp_Preview.setBounds(10, 22, 219, 354);
		panel_InfoItemPreview.add(tp_Preview);
	}
}
